﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace QuanLyThuVien
{
    public partial class QuanLyThuVien : Form
    {
        public QuanLyThuVien()
        {
            InitializeComponent();
        }
        void ClearAllChildForm()
        {
           foreach(Form frm in this.MdiChildren)
           {
               frm.Close();
           }
        }
        private void buttonX1_Click(object sender, EventArgs e)
        {
            ClearAllChildForm();
            HoSoNhanVien nv = new HoSoNhanVien();
            nv.MdiParent = this;
           //nv.MinimizeBox = false;
            nv.MaximizeBox = true;
            nv.WindowState = FormWindowState.Maximized;
            nv.Show();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {

        }

        private void buttonX2_Click(object sender, EventArgs e)
        {
            ClearAllChildForm();
            TheDocGia theDocGia = new TheDocGia();
            theDocGia.MdiParent = this;
            theDocGia.MinimizeBox = false;
            theDocGia.WindowState = FormWindowState.Maximized;
            theDocGia.Show();
        }

        private void QuanLyThuVien_Load(object sender, EventArgs e)
        {
            lblTitle.Location = new Point(pnlTitle.Width/2-lblTitle.Width/2, lblTitle.Location.Y);
            
        }

        private void buttonX6_Click(object sender, EventArgs e)
        {
            PhieuTraSach frm = new PhieuTraSach();
            this.WindowState = FormWindowState.Maximized;
            frm.Show();
            frm.MdiParent = this;
        }

        private void buttonX7_Click(object sender, EventArgs e)
        {
            ClearAllChildForm();
            GhiNhanMatSach frm = new GhiNhanMatSach();
            this.WindowState = FormWindowState.Maximized;
            frm.Show();
            frm.MdiParent = this;
        }

        private void buttonX9_Click(object sender, EventArgs e)
        {
            ClearAllChildForm();
            ThanhLySach frm = new ThanhLySach();
            this.WindowState = FormWindowState.Maximized;
            frm.Show();
            frm.MdiParent = this;
        }

        private void buttonX4_Click(object sender, EventArgs e)
        {
            ClearAllChildForm();
            TraCuuSach frm = new TraCuuSach();
            
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
            frm.MdiParent = this;

        }

       
       

        
    }
}